package com.study.patterns.proxy.dynamic.jdk;

import com.study.patterns.proxy.dynamic.ComputeService;
import com.study.patterns.proxy.dynamic.ComputeServiceImpl;

/**
 * Created by tan on 2017/6/16.
 */
public class Client {
	public static void main(String[] args) {
		ComputeService computeService = new ComputeServiceImpl();
		//null 的时候 proxy 581行   interface com.study.patterns.proxy.dynamic.ComputeService is not visible from class loader
		ServiceInvocationHandlerImpl handler = new ServiceInvocationHandlerImpl(computeService);
		ComputeService proxyService = (ComputeService)handler.getProxy();
		proxyService.add(10,20);
	}
}
